<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-3.6.0.js"></script>
</head>
<body>
<script>
    $(function (){
        $("table tr:odd").css("background-color","red")
        $("table tr:eq(0)").css("background-color","pink")
    })
</script>
<h1 align="center">个人简历信息列表</h1>
<div align="center">
<form>
    性别:<input type="radio" id="sex" checked value="男">男&nbsp<input type="radio" value="女">女&nbsp<input type="radio" value="全部">全部&nbsp&nbsp&nbsp&nbsp<input type="button" onclick="location.href='resumeAdd.jsp'" value="新增个人简历信息">
</form>
</div>
    <table border="1px" align="center">
        <tr>
            <th>姓名</th>
            <th>性别</th>
            <th>籍贯地址</th>
            <th>出生时间</th>
            <th>联系电话</th>
            <th>毕业学校</th>
            <th>简历状态</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${list}" var="resume">
            <tr>
                <td>${resume.userName}</td>
                <td>${resume.sex}</td>
                <td>${resume.address}</td>
                <td>${resume.birth}</td>
                <td>${resume.telephone}</td>
                <td>${resume.school}</td>
                <td>
                    ${resume.status==1?"公开":"保密"}
                </td>
                <td><a href="javascript:void (0)" onclick="del(${resume.id})">删除</a></td>
            </tr>
        </c:forEach>
    </table>
<script>

    function del(id) {
        if (confirm('确认要删除吗?')){
            $.getJSON(
                "ResumeDeleteServlet",
                {id:id},
                function (data){
                    if (data){
                        alert('删除成功!')
                        location.reload();
                    }else {
                        alert('删除失败!')
                    }
                }
            )
        }
    }
</script>
</body>
</html>
